Optimal. Leaf size=73 \[ -\frac{(d (A-C)+B c) \log (\cos (e+f x))}{f}+x (A c-B d-c C)+\frac{B d \tan (e+f x)}{f}+\frac{C (c+d \tan (e+f x))^2}{2 d f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0606425, antiderivative size = 73, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.097, Rules used = {3630, 3525, 3475} \[ -\frac{(d (A-C)+B c) \log (\cos (e+f x))}{f}+x (A c-B d-c C)+\frac{B d \tan (e+f x)}{f}+\frac{C (c+d \tan (e+f x))^2}{2 d f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3630
Rule 3525
Rule 3475
Rubi steps
\begin{align*} \int (c+d \tan (e+f x)) \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx &=\frac{C (c+d \tan (e+f x))^2}{2 d f}+\int (A-C+B \tan (e+f x)) (c+d \tan (e+f x)) \, dx\\ &=(A c-c C-B d) x+\frac{B d \tan (e+f x)}{f}+\frac{C (c+d \tan (e+f x))^2}{2 d f}+(B c+(A-C) d) \int \tan (e+f x) \, dx\\ &=(A c-c C-B d) x-\frac{(B c+(A-C) d) \log (\cos (e+f x))}{f}+\frac{B d \tan (e+f x)}{f}+\frac{C (c+d \tan (e+f x))^2}{2 d f}\\ \end{align*}
Mathematica [A] time = 0.446251, size = 76, normalized size = 1.04 \[ \frac{-2 (d (A-C)+B c) \log (\cos (e+f x))+2 A c f x-2 (B d+c C) \tan ^{-1}(\tan (e+f x))+2 (B d+c C) \tan (e+f x)+C d \tan ^2(e+f x)}{2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.014, size = 136, normalized size = 1.9 \begin{align*}{\frac{C \left ( \tan \left ( fx+e \right ) \right ) ^{2}d}{2\,f}}+{\frac{B\tan \left ( fx+e \right ) d}{f}}+{\frac{C\tan \left ( fx+e \right ) c}{f}}+{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) Ad}{2\,f}}+{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) Bc}{2\,f}}-{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) Cd}{2\,f}}+{\frac{A\arctan \left ( \tan \left ( fx+e \right ) \right ) c}{f}}-{\frac{B\arctan \left ( \tan \left ( fx+e \right ) \right ) d}{f}}-{\frac{C\arctan \left ( \tan \left ( fx+e \right ) \right ) c}{f}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.47783, size = 100, normalized size = 1.37 \begin{align*} \frac{C d \tan \left (f x + e\right )^{2} + 2 \,{\left ({\left (A - C\right )} c - B d\right )}{\left (f x + e\right )} +{\left (B c +{\left (A - C\right )} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 2 \,{\left (C c + B d\right )} \tan \left (f x + e\right )}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.06793, size = 177, normalized size = 2.42 \begin{align*} \frac{C d \tan \left (f x + e\right )^{2} + 2 \,{\left ({\left (A - C\right )} c - B d\right )} f x -{\left (B c +{\left (A - C\right )} d\right )} \log \left (\frac{1}{\tan \left (f x + e\right )^{2} + 1}\right ) + 2 \,{\left (C c + B d\right )} \tan \left (f x + e\right )}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.705185, size = 131, normalized size = 1.79 \begin{align*} \begin{cases} A c x + \frac{A d \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{B c \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - B d x + \frac{B d \tan{\left (e + f x \right )}}{f} - C c x + \frac{C c \tan{\left (e + f x \right )}}{f} - \frac{C d \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{C d \tan ^{2}{\left (e + f x \right )}}{2 f} & \text{for}\: f \neq 0 \\x \left (c + d \tan{\left (e \right )}\right ) \left (A + B \tan{\left (e \right )} + C \tan ^{2}{\left (e \right )}\right ) & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.81836, size = 1239, normalized size = 16.97 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]